home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Toolbox
/
Visual Basic Toolbox (P.I.E.)(1996).ISO
/
graphics
/
wave
/
form1.frm
next >
Wrap
Text File
|
1995-06-06
|
3KB
|
120 lines
VERSION 2.00
Begin Form Form1
BackColor = &H00000000&
Caption = "WAVE-DEMO"
ClientHeight = 3525
ClientLeft = 1695
ClientTop = 2850
ClientWidth = 5625
Height = 3930
Left = 1635
LinkTopic = "Form1"
ScaleHeight = 3525
ScaleWidth = 5625
Top = 2505
Width = 5745
Begin CommandButton Command3
Caption = "60"
Height = 375
Left = 120
TabIndex = 4
Top = 3000
Width = 975
End
Begin CommandButton Command2
Caption = "180"
Height = 375
Left = 2280
TabIndex = 3
Top = 3000
Width = 855
End
Begin PictureBox Picture1
AutoRedraw = -1 'True
Height = 1530
Left = 360
Picture = FORM1.FRX:0000
ScaleHeight = 1500
ScaleWidth = 4305
TabIndex = 2
Top = 4200
Width = 4335
End
Begin PictureBox Picture2
BackColor = &H00000000&
Height = 1815
Left = 120
ScaleHeight = 1785
ScaleWidth = 4785
TabIndex = 1
Top = 480
Width = 4815
End
Begin CommandButton Command1
Caption = "90"
Height = 375
Left = 1200
TabIndex = 0
Top = 3000
Width = 975
End
End
Sub Command1_Click ()
'90 parts
cnt% = 90
Call scroll
End Sub
Sub Command2_Click ()
'180 parts
cnt% = 180
Call scroll
End Sub
Sub Command3_Click ()
'60 parts
cnt% = 60
Call scroll
End Sub
Sub scroll ()
form1.ScaleMode = 3
picture1.ScaleMode = 3
picture2.ScaleMode = 3
'relative height of sine-wave
hh% = 5
' set up the sinewave
For n% = 1 To cnt%
wink(n%) = Sin(3.14159 / cnt% * n% * 360 / cnt%) * hh%
Next n%
destheight = picture2.ScaleHeight
faktx = picture1.ScaleWidth / cnt%
destwidth% = faktx
For kk% = 1 To 3
'for 3 times
For aa% = 1 To cnt%
'for all segments
For q% = 1 To cnt%
xdest = q% * faktx
temp = BitBlt(picture2.hDC, xdest, wink(q%), destwidth% + 1, destheight, picture1.hDC, xdest, 0, SRCCOPY)
Next q%
DoEvents
'now shift the sine-wave
tmp% = wink(cnt%)
For k% = 1 To cnt%
tmp1% = wink(k%)
wink(k%) = tmp%
tmp% = tmp1%
Next k%
Next aa%
Next kk%
End Sub